package com.qi.springcloud.serviceorder.dao;

import com.qi.springcloud.serviceorder.bean.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 源码学院-Fox
 * 只为培养BAT程序员而生
 * http://com.qi.springcloud
 * 往期视频加群:516212256 暗号:6
 */
@Mapper
public interface OrderMapper {

    @Insert("INSERT INTO t_order(userId,amount) VALUES(#{userId},#{amount})")
    void insert(Order order);

    @Select("select * from t_order where id=#{id}")
    Order getById(Integer id);

    @Select("select * from t_order where user_id=#{userId}")
    List<Order> findOrderByUserId(Integer userId);

}
